// source --> https://www.moderne-einrichtung.de/wp-content/plugins/cookie-law-info/public/js/cookie-law-info-public.js?ver=2.0.0 CLI_ACCEPT_COOKIE_NAME =(typeof CLI_ACCEPT_COOKIE_NAME !== 'undefined' ? CLI_ACCEPT_COOKIE_NAME : 'viewed_cookie_policy'); CLI_PREFERNCE_COOKIE =(typeof CLI_PREFERNCE_COOKIE !== 'undefined' ? CLI_PREFERNCE_COOKIE : 'CookieLawInfoConsent'); CLI_ACCEPT_COOKIE_EXPIRE =(typeof CLI_ACCEPT_COOKIE_EXPIRE !== 'undefined' ? CLI_ACCEPT_COOKIE_EXPIRE : 365); CLI_COOKIEBAR_AS_POPUP=(typeof CLI_COOKIEBAR_AS_POPUP !== 'undefined' ? CLI_COOKIEBAR_AS_POPUP : false); var CLI_Cookie={ set: function (name, value, days) { if (days) { var date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); var expires = "; expires=" + date.toGMTString(); } else var expires = ""; document.cookie = name + "=" + value + expires + "; path=/"; if(days<1) { host_name=window.location.hostname; document.cookie = name + "=" + value + expires + "; path=/; domain=."+host_name+";"; if(host_name.indexOf("www")!=1) { var host_name_withoutwww=host_name.replace('www',''); document.cookie = name + "=" + value + expires + "; path=/; domain="+host_name_withoutwww+";"; } host_name=host_name.substring(host_name.lastIndexOf(".", host_name.lastIndexOf(".")-1)); document.cookie = name + "=" + value + expires + "; path=/; domain="+host_name+";"; } }, read: function (name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1, c.length); } if (c.indexOf(nameEQ) === 0) { return c.substring(nameEQ.length, c.length); } } return null; }, erase: function (name) { this.set(name, "", -10); }, exists: function (name) { return (this.read(name) !== null); }, getallcookies:function() { var pairs = document.cookie.split(";"); var cookieslist = {}; for (var i = 0; i < pairs.length; i++) { var pair = pairs[i].split("="); cookieslist[(pair[0] + '').trim()] = unescape(pair[1]); } return cookieslist; } } var CLI= { bar_config:{}, showagain_config:{}, allowedCategories:[], js_blocking_enabled: false, set:function(args) { if(typeof JSON.parse !== "function") { console.log("CookieLawInfo requires JSON.parse but your browser doesn't support it"); return; } if(typeof args.settings!=='object') { this.settings = JSON.parse(args.settings); } else { this.settings = args.settings; } this.js_blocking_enabled = Boolean( Cli_Data.js_blocking ); this.settings = args.settings; this.bar_elm = jQuery(this.settings.notify_div_id); this.showagain_elm = jQuery(this.settings.showagain_div_id); this.settingsModal = jQuery('#cliSettingsPopup'); /* buttons */ this.main_button=jQuery('.cli-plugin-main-button'); this.main_link = jQuery('.cli-plugin-main-link'); this.reject_link = jQuery('.cookie_action_close_header_reject'); this.delete_link=jQuery(".cookielawinfo-cookie-delete"); this.settings_button=jQuery('.cli_settings_button'); if(this.settings.cookie_bar_as=='popup') { CLI_COOKIEBAR_AS_POPUP=true; } this.addStyleAttribute(); this.configBar(); this.toggleBar(); this.attachDelete(); this.attachEvents(); this.configButtons(); this.reviewConsent(); var cli_hidebar_on_readmore=this.hideBarInReadMoreLink(); if( Boolean( this.settings.scroll_close ) ===true && cli_hidebar_on_readmore===false) { window.addEventListener("scroll",CLI.closeOnScroll, false); } }, hideBarInReadMoreLink:function() { if( Boolean( CLI.settings.button_2_hidebar ) === true && this.main_link.length>0 && this.main_link.hasClass('cli-minimize-bar')) { this.hideHeader(); cliBlocker.cookieBar( false ); this.showagain_elm.slideDown(this.settings.animate_speed_show); return true; } return false; }, attachEvents:function() { jQuery(document).on('click','.wt-cli-privacy-btn',function(e){ e.preventDefault(); CLI.accept_close(); CLI.settingsPopUpClose(); }); jQuery('.cli_action_button').on("click", function(e) { e.preventDefault(); var elm=jQuery(this); var button_action=elm.attr('data-cli_action'); var open_link=elm[0].hasAttribute("href") && elm.attr("href") != '#' ? true : false; var new_window=false; if(button_action=='accept') { CLI.accept_close(); new_window= Boolean( CLI.settings.button_1_new_win ) ? true : false; }else if(button_action=='reject') { CLI.reject_close(); new_window= Boolean( CLI.settings.button_3_new_win ) ? true : false; } if(open_link) { if(new_window) { window.open(elm.attr("href"),'_blank'); }else { window.location.href =elm.attr("href"); } } }); this.settingsPopUp(); this.settingsTabbedAccordion(); this.toggleUserPreferenceCheckBox(); this.hideCookieBarOnClose(); this.cookieLawInfoRunCallBacks(); }, toggleUserPreferenceCheckBox:function() { jQuery('.cli-user-preference-checkbox').each(function(){ categoryCookie = 'cookielawinfo-'+jQuery(this).attr('data-id'); categoryCookieValue = CLI_Cookie.read(categoryCookie); if( categoryCookieValue == null ) { if(jQuery(this).is(':checked')) { CLI_Cookie.set(categoryCookie,'yes',CLI_ACCEPT_COOKIE_EXPIRE); }else { CLI_Cookie.set(categoryCookie,'no',CLI_ACCEPT_COOKIE_EXPIRE); } } else { if(categoryCookieValue == "yes") { jQuery(this).prop("checked",true); } else { jQuery(this).prop("checked",false); } } }); jQuery('.cli-user-preference-checkbox').on("click", function(e) { var dataID = jQuery(this).attr('data-id'); var currentToggleElm = jQuery('.cli-user-preference-checkbox[data-id='+dataID+']'); if(jQuery(this).is(':checked')) { CLI_Cookie.set('cookielawinfo-'+dataID,'yes',CLI_ACCEPT_COOKIE_EXPIRE); currentToggleElm.prop('checked',true); }else { CLI_Cookie.set('cookielawinfo-'+dataID,'no',CLI_ACCEPT_COOKIE_EXPIRE); currentToggleElm.prop('checked',false); } CLI.checkCategories(); CLI.generateConsent(); }); }, settingsPopUp:function() { jQuery(document).on('click','.cli_settings_button',function(e){ e.preventDefault(); CLI.settingsModal.addClass("cli-show").css({'opacity':0}).animate({'opacity':1}); CLI.settingsModal.removeClass('cli-blowup cli-out').addClass("cli-blowup"); jQuery('body').addClass("cli-modal-open"); jQuery(".cli-settings-overlay").addClass("cli-show"); jQuery("#cookie-law-info-bar").css({'opacity':.1}); if(!jQuery('.cli-settings-mobile').is(':visible')) { CLI.settingsModal.find('.cli-nav-link:eq(0)').trigger("click"); } }); jQuery('#cliModalClose').on("click", function(e) { CLI.settingsPopUpClose(); }); CLI.settingsModal.on("click", function(e) { if(!(document.getElementsByClassName('cli-modal-dialog')[0].contains(e.target))) { CLI.settingsPopUpClose(); } }); jQuery('.cli_enable_all_btn').on("click", function(e) { var cli_toggle_btn = jQuery(this); var enable_text = cli_toggle_btn.attr('data-enable-text'); var disable_text= cli_toggle_btn.attr('data-disable-text'); if(cli_toggle_btn.hasClass('cli-enabled')){ CLI.disableAllCookies(); cli_toggle_btn.html(enable_text); } else { CLI.enableAllCookies(); cli_toggle_btn.html(disable_text); } jQuery(this).toggleClass('cli-enabled'); }); this.privacyReadmore(); }, settingsTabbedAccordion:function() { jQuery(".cli-tab-header").on("click", function(e) { if(!(jQuery(e.target).hasClass('cli-slider') || jQuery(e.target).hasClass('cli-user-preference-checkbox'))) { if (jQuery(this).hasClass("cli-tab-active")) { jQuery(this).removeClass("cli-tab-active"); jQuery(this) .siblings(".cli-tab-content") .slideUp(200); } else { jQuery(".cli-tab-header").removeClass("cli-tab-active"); jQuery(this).addClass("cli-tab-active"); jQuery(".cli-tab-content").slideUp(200); jQuery(this) .siblings(".cli-tab-content") .slideDown(200); } } }); }, settingsPopUpClose:function() { this.settingsModal.removeClass('cli-show'); this.settingsModal.addClass('cli-out'); jQuery('body').removeClass("cli-modal-open"); jQuery(".cli-settings-overlay").removeClass("cli-show"); jQuery("#cookie-law-info-bar").css({'opacity':1}); }, privacyReadmore:function() { var el= jQuery('.cli-privacy-content .cli-privacy-content-text'); if( el.length > 0 ) { var clone= el.clone(), originalHtml= clone.html(), originalHeight= el.outerHeight(), Trunc = { addReadmore:function(textBlock) { if(textBlock.html().length > 250) { jQuery('.cli-privacy-readmore').show(); } else { jQuery('.cli-privacy-readmore').hide(); } }, truncateText : function( textBlock ) { var strippedText = jQuery('
').html(textBlock.html()); strippedText.find('table').remove(); textBlock.html(strippedText.html()); currentText = textBlock.text(); if(currentText.trim().length > 250){ var newStr = currentText.substring(0, 250); textBlock.empty().html(newStr).append('...'); } }, replaceText: function ( textBlock, original ){ return textBlock.html(original); } }; Trunc.addReadmore(el); Trunc.truncateText(el); jQuery('a.cli-privacy-readmore').on("click", function(e) { e.preventDefault(); if(jQuery('.cli-privacy-overview').hasClass('cli-collapsed')) { Trunc.truncateText(el); jQuery('.cli-privacy-overview').removeClass('cli-collapsed'); el.css('height', '100%'); } else { jQuery('.cli-privacy-overview').addClass('cli-collapsed'); Trunc.replaceText(el, originalHtml); } }); } }, attachDelete:function() { this.delete_link.on("click", function(e) { CLI_Cookie.erase(CLI_ACCEPT_COOKIE_NAME); for(var k in Cli_Data.nn_cookie_ids) { CLI_Cookie.erase(Cli_Data.nn_cookie_ids[k]); } CLI.generateConsent(); return false; }); }, configButtons:function() { /*[cookie_button] */ this.main_button.css('color',this.settings.button_1_link_colour); if( Boolean( this.settings.button_1_as_button ) ) { this.main_button.css('background-color',this.settings.button_1_button_colour); this.main_button.on('mouseenter', function(){ jQuery(this).css('background-color',CLI.settings.button_1_button_hover); }) .on('mouseleave', function(){ jQuery(this).css('background-color',CLI.settings.button_1_button_colour); }); } /* [cookie_link] */ this.main_link.css('color',this.settings.button_2_link_colour); if( Boolean( this.settings.button_2_as_button ) ) { this.main_link.css('background-color',this.settings.button_2_button_colour); this.main_link.on('mouseenter', function(){ jQuery(this).css('background-color',CLI.settings.button_2_button_hover); }) .on('mouseleave', function(){ jQuery(this).css('background-color',CLI.settings.button_2_button_colour); }); } /* [cookie_reject] */ this.reject_link.css('color',this.settings.button_3_link_colour); if( Boolean( this.settings.button_3_as_button ) ) { this.reject_link.css('background-color',this.settings.button_3_button_colour); this.reject_link.on('mouseenter', function(){ jQuery(this).css('background-color',CLI.settings.button_3_button_hover); }) .on('mouseleave', function(){ jQuery(this).css('background-color',CLI.settings.button_3_button_colour); }); } /* [cookie_settings] */ this.settings_button.css('color',this.settings.button_4_link_colour); if( Boolean( this.settings.button_4_as_button ) ) { this.settings_button.css('background-color',this.settings.button_4_button_colour); this.settings_button.on('mouseenter', function(){ jQuery(this).css('background-color',CLI.settings.button_4_button_hover); }) .on('mouseleave', function(){ jQuery(this).css('background-color',CLI.settings.button_4_button_colour); }); } }, toggleBar:function() { if(CLI_COOKIEBAR_AS_POPUP) { this.barAsPopUp(1); } if(CLI.settings.cookie_bar_as=='widget') { this.barAsWidget(1); } if(!CLI_Cookie.exists(CLI_ACCEPT_COOKIE_NAME)) { this.displayHeader(); }else { this.hideHeader(); } if( Boolean( this.settings.show_once_yn )) { setTimeout(function(){ CLI.close_header(); },CLI.settings.show_once); } if( CLI.js_blocking_enabled === false ) { if( Boolean( Cli_Data.ccpaEnabled ) === true ) { if( Cli_Data.ccpaType === 'ccpa' && Boolean( Cli_Data.ccpaBarEnabled ) === false ) { cliBlocker.cookieBar( false ); } } else { jQuery('.wt-cli-ccpa-opt-out,.wt-cli-ccpa-checkbox,.wt-cli-ccpa-element').remove(); } } this.showagain_elm.on("click", function(e) { e.preventDefault(); CLI.showagain_elm.slideUp(CLI.settings.animate_speed_hide,function() { CLI.bar_elm.slideDown(CLI.settings.animate_speed_show); if(CLI_COOKIEBAR_AS_POPUP) { CLI.showPopupOverlay(); } }); }); }, configShowAgain:function() { this.showagain_config = { 'background-color': this.settings.background, 'color':this.l1hs(this.settings.text), 'position': 'fixed', 'font-family': this.settings.font_family }; if(Boolean( this.settings.border_on ) ) { var border_to_hide = 'border-' + this.settings.notify_position_vertical; this.showagain_config['border'] = '1px solid ' + this.l1hs(this.settings.border); this.showagain_config[border_to_hide] = 'none'; } var cli_win=jQuery(window); var cli_winw=cli_win.width(); var showagain_x_pos=this.settings.showagain_x_position; if(cli_winw<300) { showagain_x_pos=10; this.showagain_config.width=cli_winw-20; }else { this.showagain_config.width='auto'; } var cli_defw=cli_winw>400 ? 500 : cli_winw-20; if(CLI_COOKIEBAR_AS_POPUP) /* cookie bar as popup */ { var sa_pos=this.settings.popup_showagain_position; var sa_pos_arr=sa_pos.split('-'); if(sa_pos_arr[1]=='left') { this.showagain_config.left=showagain_x_pos; }else if(sa_pos_arr[1]=='right') { this.showagain_config.right=showagain_x_pos; } if(sa_pos_arr[0]=='top') { this.showagain_config.top=0; }else if(sa_pos_arr[0]=='bottom') { this.showagain_config.bottom=0; } this.bar_config['position'] = 'fixed'; }else if(this.settings.cookie_bar_as=='widget') { this.showagain_config.bottom=0; if(this.settings.widget_position=='left') { this.showagain_config.left=showagain_x_pos; }else if(this.settings.widget_position=='right') { this.showagain_config.right=showagain_x_pos; } } else { if(this.settings.notify_position_vertical == "top") { this.showagain_config.top = '0'; } else if(this.settings.notify_position_vertical == "bottom") { this.bar_config['position'] = 'fixed'; this.bar_config['bottom'] = '0'; this.showagain_config.bottom = '0'; } if(this.settings.notify_position_horizontal == "left") { this.showagain_config.left =showagain_x_pos; }else if(this.settings.notify_position_horizontal == "right") { this.showagain_config.right =showagain_x_pos; } } this.showagain_elm.css(this.showagain_config); }, configBar:function() { this.bar_config = { 'background-color':this.settings.background, 'color':this.settings.text, 'font-family':this.settings.font_family }; if(this.settings.notify_position_vertical=="top") { this.bar_config['top'] = '0'; if( Boolean( this.settings.header_fix ) === true) { this.bar_config['position'] = 'fixed'; } }else { this.bar_config['bottom'] = '0'; } this.configShowAgain(); this.bar_elm.css(this.bar_config).hide(); }, l1hs:function(str) { if (str.charAt(0) == "#") { str = str.substring(1, str.length); } else { return "#" + str; } return this.l1hs(str); }, close_header:function() { CLI_Cookie.set(CLI_ACCEPT_COOKIE_NAME,'yes',CLI_ACCEPT_COOKIE_EXPIRE); this.hideHeader(); }, accept_close:function() { this.hidePopupOverlay(); this.generateConsent(); this.cookieLawInfoRunCallBacks(); CLI_Cookie.set(CLI_ACCEPT_COOKIE_NAME,'yes',CLI_ACCEPT_COOKIE_EXPIRE); if( Boolean( this.settings.notify_animate_hide ) ) { if( CLI.js_blocking_enabled === true ) { this.bar_elm.slideUp( this.settings.animate_speed_hide, cliBlocker.runScripts ); } else { this.bar_elm.slideUp( this.settings.animate_speed_hide ); } }else { if( CLI.js_blocking_enabled === true ) { this.bar_elm.hide( cliBlocker.runScripts ); } else { this.bar_elm.hide(); } } if( Boolean( this.settings.showagain_tab ) ) { this.showagain_elm.slideDown(this.settings.animate_speed_show); } if( Boolean( this.settings.accept_close_reload ) === true ) { this.reload_current_page(); } return false; }, reject_close:function() { this.hidePopupOverlay(); this.generateConsent(); this.cookieLawInfoRunCallBacks(); for(var k in Cli_Data.nn_cookie_ids) { CLI_Cookie.erase(Cli_Data.nn_cookie_ids[k]); } CLI_Cookie.set(CLI_ACCEPT_COOKIE_NAME,'no',CLI_ACCEPT_COOKIE_EXPIRE); if( Boolean( this.settings.notify_animate_hide ) ) { if( CLI.js_blocking_enabled === true ) { this.bar_elm.slideUp(this.settings.animate_speed_hide, cliBlocker.runScripts); } else { this.bar_elm.slideUp(this.settings.animate_speed_hide); } } else { if( CLI.js_blocking_enabled === true ) { this.bar_elm.hide( cliBlocker.runScripts ); } else { this.bar_elm.hide(); } } if( Boolean( this.settings.showagain_tab ) ) { this.showagain_elm.slideDown(this.settings.animate_speed_show); } if( Boolean( this.settings.reject_close_reload ) === true ) { this.reload_current_page(); } return false; }, reload_current_page:function() { if(typeof cli_flush_cache!=='undefined' && cli_flush_cache === true) { window.location.href=this.add_clear_cache_url_query(); }else { window.location.reload(true); } }, add_clear_cache_url_query:function() { var cli_rand=new Date().getTime()/1000; var cli_url=window.location.href; var cli_hash_arr=cli_url.split('#'); var cli_urlparts= cli_hash_arr[0].split('?'); if(cli_urlparts.length>=2) { var cli_url_arr=cli_urlparts[1].split('&'); cli_url_temp_arr=new Array(); for(var cli_i=0; cli_i0 ? '&': '')+'cli_action='; }else { cli_url=cli_hash_arr[0]+'?cli_action='; } cli_url+=cli_rand; if(cli_hash_arr.length>1) { cli_url+='#'+cli_hash_arr[1]; } return cli_url; }, closeOnScroll:function() { if(window.pageYOffset > 100 && !CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME)) { CLI.accept_close(); if( Boolean( CLI.settings.scroll_close_reload ) === true) { window.location.reload(); } window.removeEventListener("scroll",CLI.closeOnScroll,false); } }, displayHeader:function() { if( Boolean( this.settings.notify_animate_show ) ) { this.bar_elm.slideDown(this.settings.animate_speed_show); }else { this.bar_elm.show(); } this.showagain_elm.hide(); if(CLI_COOKIEBAR_AS_POPUP) { this.showPopupOverlay(); } }, hideHeader:function() { if( Boolean( this.settings.showagain_tab ) ) { if( Boolean( this.settings.notify_animate_show ) ) { this.showagain_elm.slideDown(this.settings.animate_speed_show); } else { this.showagain_elm.show(); } }else { this.showagain_elm.hide(); } this.bar_elm.slideUp(this.settings.animate_speed_show); this.hidePopupOverlay(); }, hidePopupOverlay:function() { jQuery('body').removeClass("cli-barmodal-open"); jQuery(".cli-popupbar-overlay").removeClass("cli-show"); }, showPopupOverlay:function() { if( this.bar_elm.length ) { if( Boolean( this.settings.popup_overlay ) ) { jQuery('body').addClass("cli-barmodal-open"); jQuery(".cli-popupbar-overlay").addClass("cli-show"); } } }, barAsWidget:function(a) { var cli_elm=this.bar_elm; cli_elm.attr('data-cli-type','widget'); var cli_win=jQuery(window); var cli_winh=cli_win.height()-40; var cli_winw=cli_win.width(); var cli_defw=cli_winw>400 ? 300 : cli_winw-30; cli_elm.css({ 'width':cli_defw,'height':'auto','max-height':cli_winh,'overflow':'auto','position':'fixed','box-sizing':'border-box' }); if ( this.checkifStyleAttributeExist() === false ) { cli_elm.css({'padding':'25px 15px'}); } if(this.settings.widget_position=='left') { cli_elm.css({ 'left':'15px','right':'auto','bottom':'15px','top':'auto' }); }else { cli_elm.css({ 'left':'auto','right':'15px','bottom':'15px','top':'auto' }); } if(a) { this.setResize(); } }, barAsPopUp:function(a) { if(typeof cookie_law_info_bar_as_popup==='function') { return false; } var cli_elm=this.bar_elm; cli_elm.attr('data-cli-type','popup'); var cli_win=jQuery(window); var cli_winh=cli_win.height()-40; var cli_winw=cli_win.width(); var cli_defw=cli_winw>700 ? 500 : cli_winw-20; cli_elm.css({ 'width':cli_defw,'height':'auto','max-height':cli_winh,'bottom':'','top':'50%','left':'50%','margin-left':(cli_defw/2)*-1,'margin-top':'-100px','overflow':'auto' }).addClass('cli-bar-popup cli-modal-content'); if ( this.checkifStyleAttributeExist() === false ) { cli_elm.css({'padding':'25px 15px'}); } cli_h=cli_elm.height(); li_h=cli_h<200 ? 200 : cli_h; cli_elm.css({'top':'50%','margin-top':((cli_h/2)+30)*-1}); setTimeout(function(){ cli_elm.css({ 'bottom':'' }); },100); if(a) { this.setResize(); } }, setResize:function() { var resizeTmr=null; jQuery(window).resize(function() { clearTimeout(resizeTmr); resizeTmr=setTimeout(function() { if(CLI_COOKIEBAR_AS_POPUP) { CLI.barAsPopUp(); } if(CLI.settings.cookie_bar_as=='widget') { CLI.barAsWidget(); } CLI.configShowAgain(); },500); }); }, enableAllCookies:function() { jQuery('.cli-user-preference-checkbox').each(function(){ var cli_chkbox_elm=jQuery(this); var cli_chkbox_data_id=cli_chkbox_elm.attr('data-id'); if(cli_chkbox_data_id!='checkbox-necessary') { cli_chkbox_elm.prop('checked',true); CLI_Cookie.set('cookielawinfo-'+cli_chkbox_data_id,'yes',CLI_ACCEPT_COOKIE_EXPIRE); } }); }, hideCookieBarOnClose: function() { jQuery(document).on('click','.cli_cookie_close_button',function(e){ e.preventDefault(); var elm=jQuery(this); var button_action = elm.attr('data-cli_action'); if( Cli_Data.ccpaType === 'ccpa' ) { CLI.enableAllCookies(); } CLI.accept_close(); }); }, checkCategories:function() { var cliAllowedCategories = []; var cli_categories = {}; jQuery('.cli-user-preference-checkbox').each(function() { var status=false; cli_chkbox_elm=jQuery(this); cli_chkbox_data_id=cli_chkbox_elm.attr('data-id'); cli_chkbox_data_id=cli_chkbox_data_id.replace('checkbox-',''); cli_chkbox_data_id_trimmed=cli_chkbox_data_id.replace('-','_') if(jQuery(cli_chkbox_elm).is(':checked')) { status=true; cliAllowedCategories.push(cli_chkbox_data_id); } cli_categories[cli_chkbox_data_id_trimmed]= status; }); CLI.allowedCategories = cliAllowedCategories; }, cookieLawInfoRunCallBacks:function() { this.checkCategories(); if(CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME)=='yes') { if("function" == typeof CookieLawInfo_Accept_Callback){ CookieLawInfo_Accept_Callback(); } } }, generateConsent:function() { var preferenceCookie = CLI_Cookie.read(CLI_PREFERNCE_COOKIE); cliConsent = {}; if(preferenceCookie !== null) { cliConsent = window.atob(preferenceCookie); cliConsent = JSON.parse(cliConsent); } cliConsent.ver = Cli_Data.consentVersion; categories = []; jQuery('.cli-user-preference-checkbox').each(function(){ categoryVal = ''; cli_chkbox_data_id = jQuery(this).attr('data-id'); cli_chkbox_data_id = cli_chkbox_data_id.replace('checkbox-',''); if(jQuery(this).is(':checked')) { categoryVal = true; } else { categoryVal = false; } cliConsent[cli_chkbox_data_id] = categoryVal; }); cliConsent = JSON.stringify(cliConsent); cliConsent = window.btoa(cliConsent); CLI_Cookie.set(CLI_PREFERNCE_COOKIE,cliConsent,CLI_ACCEPT_COOKIE_EXPIRE); }, addStyleAttribute:function() { var bar=this.bar_elm; var styleClass=''; if(jQuery(bar).find('.cli-bar-container').length > 0) { styleClass = jQuery('.cli-bar-container').attr('class'); styleClass = styleClass.replace('cli-bar-container',''); styleClass = styleClass.trim(); jQuery(bar).attr('data-cli-style',styleClass); } }, getParameterByName: function( name, url ) { if (!url) url = window.location.href; name = name.replace(/[\[\]]/g, '\\$&'); var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), results = regex.exec(url); if (!results) return null; if (!results[2]) return ''; return decodeURIComponent(results[2].replace(/\+/g, ' ')); }, CookieLawInfo_Callback: function( enableBar, enableBlocking ) { enableBar = typeof enableBar !== 'undefined' ? enableBar : true; enableBlocking = typeof enableBlocking !== 'undefined' ? enableBlocking : true; if( CLI.js_blocking_enabled === true && Boolean( Cli_Data.custom_integration ) === true ) { cliBlocker.cookieBar( enableBar ); cliBlocker.runScripts( enableBlocking ); } }, checkifStyleAttributeExist: function() { var exist = false; var attr = this.bar_elm.attr('data-cli-style'); if (typeof attr !== typeof undefined && attr !== false) { exist = true; } return exist; }, reviewConsent : function() { jQuery(document).on('click','.cli_manage_current_consent,.wt-cli-manage-consent-link',function(){ CLI.displayHeader(); }); } } var cliBlocker = { blockingStatus: true, scriptsLoaded: false, ccpaEnabled : false, ccpaRegionBased : false, ccpaApplicable : false, ccpaBarEnabled: false, cliShowBar: true , isBypassEnabled: CLI.getParameterByName('cli_bypass'), checkPluginStatus: function(callbackA , callbackB ) { this.ccpaEnabled = Boolean( Cli_Data.ccpaEnabled ); this.ccpaRegionBased = Boolean( Cli_Data.ccpaRegionBased ); this.ccpaBarEnabled = Boolean( Cli_Data.ccpaBarEnabled ); if( Boolean( Cli_Data.custom_integration ) === true ) { callbackA( false ); } else { if( this.ccpaEnabled === true ) { this.ccpaApplicable = true; if( Cli_Data.ccpaType === 'ccpa') { if( this.ccpaBarEnabled !== true ) { this.cliShowBar = false; this.blockingStatus = false; } } } else { jQuery('.wt-cli-ccpa-opt-out,.wt-cli-ccpa-checkbox,.wt-cli-ccpa-element').remove(); } if ( cliBlocker.isBypassEnabled === "1") { cliBlocker.blockingStatus = false; } callbackA( this.cliShowBar ); callbackB( this.blockingStatus); } }, cookieBar: function( showbar ) { showbar = typeof showbar !== 'undefined' ? showbar : true; cliBlocker.cliShowBar = showbar; if(cliBlocker.cliShowBar === false) { CLI.bar_elm.hide(); CLI.showagain_elm.hide(); CLI.settingsModal.removeClass('cli-blowup cli-out'); CLI.hidePopupOverlay(); jQuery(".cli-settings-overlay").removeClass("cli-show"); } else { if(!CLI_Cookie.exists(CLI_ACCEPT_COOKIE_NAME)) { CLI.displayHeader(); } else { CLI.hideHeader(); } CLI.settingsModal.show(); jQuery('.cli-modal-backdrop').show(); } }, removeCookieByCategory : function() { if(cliBlocker.blockingStatus === true) { if(CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME) !== null) { var non_necessary_cookies = Cli_Data.non_necessary_cookies; for (var key in non_necessary_cookies) { currentCategory = key; if(CLI.allowedCategories.indexOf(currentCategory) === -1) { var nonNecessaryCookies = non_necessary_cookies[currentCategory]; for(var i=0; i < nonNecessaryCookies.length; i++) { if(CLI_Cookie.read(nonNecessaryCookies[i]) !== null) { CLI_Cookie.erase(nonNecessaryCookies[i]); } } } } } } }, runScripts:function( blocking ) { blocking = typeof blocking !== 'undefined' ? blocking : true; cliBlocker.blockingStatus = blocking; srcReplaceableElms = ['iframe','IFRAME','EMBED','embed','OBJECT','object','IMG','img']; var genericFuncs = { renderByElement: function( callback ) { cliScriptFuncs.renderScripts(); callback(); cliBlocker.scriptsLoaded = true; }, }; var cliScriptFuncs = { // trigger DOMContentLoaded scriptsDone:function() { if (typeof Cli_Data.triggerDomRefresh !== 'undefined') { if( Boolean( Cli_Data.triggerDomRefresh ) === true ) { var DOMContentLoadedEvent = document.createEvent('Event') DOMContentLoadedEvent.initEvent('DOMContentLoaded', true, true) window.document.dispatchEvent(DOMContentLoadedEvent); } } }, seq :function(arr, callback, index) { // first call, without an index if (typeof index === 'undefined') { index = 0 } arr[index](function () { index++ if (index === arr.length) { callback() } else { cliScriptFuncs.seq(arr, callback, index) } }) }, /* script runner */ insertScript:function($script,callback) { var s =''; var scriptType = $script.getAttribute('data-cli-script-type'); var elementPosition = $script.getAttribute('data-cli-element-position'); var isBlock = $script.getAttribute('data-cli-block'); var s = document.createElement('script'); var ccpaOptedOut = cliBlocker.ccpaOptedOut(); s.type = 'text/plain'; if($script.async) { s.async = $script.async; } if($script.defer) { s.defer = $script.defer; } if ($script.src) { s.onload = callback s.onerror = callback s.src = $script.src } else { s.textContent = $script.innerText } var attrs = jQuery($script).prop("attributes"); for (var ii = 0; ii < attrs.length; ++ii) { if (attrs[ii].nodeName !== 'id') { s.setAttribute(attrs[ii].nodeName,attrs[ii].value); } } if(cliBlocker.blockingStatus === true) { if(( CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME)=='yes' && CLI.allowedCategories.indexOf(scriptType) !== -1 ) ) { s.setAttribute('data-cli-consent','accepted'); s.type = 'text/javascript'; } if( cliBlocker.ccpaApplicable === true ) { if( ccpaOptedOut === true || CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME) == null ) { s.type = 'text/plain'; } } } else { s.type = 'text/javascript'; } if($script.type != s.type) { if(elementPosition === 'head') { document.head.appendChild(s); } else { document.body.appendChild(s); } if (!$script.src) { callback() } $script.parentNode.removeChild($script); } else { callback(); } }, renderScripts:function() { var $scripts = document.querySelectorAll('script[data-cli-class="cli-blocker-script"]'); if($scripts.length > 0) { var runList = [] var typeAttr Array.prototype.forEach.call($scripts, function ($script) { // only run script tags without the type attribute // or with a javascript mime attribute value typeAttr = $script.getAttribute('type') runList.push(function (callback) { cliScriptFuncs.insertScript($script, callback) }) }) cliScriptFuncs.seq(runList, cliScriptFuncs.scriptsDone); } } }; genericFuncs.renderByElement( cliBlocker.removeCookieByCategory ); }, ccpaOptedOut : function () { var ccpaOptedOut = false; var preferenceCookie = CLI_Cookie.read(CLI_PREFERNCE_COOKIE); if( preferenceCookie !== null ) { cliConsent = window.atob(preferenceCookie); cliConsent = JSON.parse(cliConsent); if( typeof cliConsent.ccpaOptout !== 'undefined') { ccpaOptedOut = cliConsent.ccpaOptout; } } return ccpaOptedOut; } } jQuery(document).ready(function() { if(typeof cli_cookiebar_settings!='undefined') { CLI.set({ settings:cli_cookiebar_settings }); if( CLI.js_blocking_enabled === true ) { cliBlocker.checkPluginStatus(cliBlocker.cookieBar,cliBlocker.runScripts); } } }); // source --> https://www.moderne-einrichtung.de/wp-content/themes/shophistic/js/modernizr.custom.67069.js?ver=1 /* Modernizr 2.8.3 (Custom Build) | MIT & BSD * Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-draganddrop-history-audio-video-localstorage-postmessage-inlinesvg-svg-svgclippaths-touch-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes */ ; window.Modernizr = (function( window, document, undefined ) { var version = '2.8.3', Modernizr = {}, enableClasses = true, docElement = document.documentElement, mod = 'modernizr', modElem = document.createElement(mod), mStyle = modElem.style, inputElem , smile = ':)', toString = {}.toString, prefixes = ' -webkit- -moz- -o- -ms- '.split(' '), omPrefixes = 'Webkit Moz O ms', cssomPrefixes = omPrefixes.split(' '), domPrefixes = omPrefixes.toLowerCase().split(' '), ns = {'svg': 'http://www.w3.org/2000/svg'}, tests = {}, inputs = {}, attrs = {}, classes = [], slice = classes.slice, featureName, injectElementWithStyles = function( rule, callback, nodes, testnames ) { var style, ret, node, docOverflow, div = document.createElement('div'), body = document.body, fakeBody = body || document.createElement('body'); if ( parseInt(nodes, 10) ) { while ( nodes-- ) { node = document.createElement('div'); node.id = testnames ? testnames[nodes] : mod + (nodes + 1); div.appendChild(node); } } style = ['­',''].join(''); div.id = mod; (body ? div : fakeBody).innerHTML += style; fakeBody.appendChild(div); if ( !body ) { fakeBody.style.background = ''; fakeBody.style.overflow = 'hidden'; docOverflow = docElement.style.overflow; docElement.style.overflow = 'hidden'; docElement.appendChild(fakeBody); } ret = callback(div, rule); if ( !body ) { fakeBody.parentNode.removeChild(fakeBody); docElement.style.overflow = docOverflow; } else { div.parentNode.removeChild(div); } return !!ret; }, isEventSupported = (function() { var TAGNAMES = { 'select': 'input', 'change': 'input', 'submit': 'form', 'reset': 'form', 'error': 'img', 'load': 'img', 'abort': 'img' }; function isEventSupported( eventName, element ) { element = element || document.createElement(TAGNAMES[eventName] || 'div'); eventName = 'on' + eventName; var isSupported = eventName in element; if ( !isSupported ) { if ( !element.setAttribute ) { element = document.createElement('div'); } if ( element.setAttribute && element.removeAttribute ) { element.setAttribute(eventName, ''); isSupported = is(element[eventName], 'function'); if ( !is(element[eventName], 'undefined') ) { element[eventName] = undefined; } element.removeAttribute(eventName); } } element = null; return isSupported; } return isEventSupported; })(), _hasOwnProperty = ({}).hasOwnProperty, hasOwnProp; if ( !is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined') ) { hasOwnProp = function (object, property) { return _hasOwnProperty.call(object, property); }; } else { hasOwnProp = function (object, property) { return ((property in object) && is(object.constructor.prototype[property], 'undefined')); }; } if (!Function.prototype.bind) { Function.prototype.bind = function bind(that) { var target = this; if (typeof target != "function") { throw new TypeError(); } var args = slice.call(arguments, 1), bound = function () { if (this instanceof bound) { var F = function(){}; F.prototype = target.prototype; var self = new F(); var result = target.apply( self, args.concat(slice.call(arguments)) ); if (Object(result) === result) { return result; } return self; } else { return target.apply( that, args.concat(slice.call(arguments)) ); } }; return bound; }; } function setCss( str ) { mStyle.cssText = str; } function setCssAll( str1, str2 ) { return setCss(prefixes.join(str1 + ';') + ( str2 || '' )); } function is( obj, type ) { return typeof obj === type; } function contains( str, substr ) { return !!~('' + str).indexOf(substr); } function testProps( props, prefixed ) { for ( var i in props ) { var prop = props[i]; if ( !contains(prop, "-") && mStyle[prop] !== undefined ) { return prefixed == 'pfx' ? prop : true; } } return false; } function testDOMProps( props, obj, elem ) { for ( var i in props ) { var item = obj[props[i]]; if ( item !== undefined) { if (elem === false) return props[i]; if (is(item, 'function')){ return item.bind(elem || obj); } return item; } } return false; } function testPropsAll( prop, prefixed, elem ) { var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1), props = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' '); if(is(prefixed, "string") || is(prefixed, "undefined")) { return testProps(props, prefixed); } else { props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' '); return testDOMProps(props, prefixed, elem); } } tests['flexbox'] = function() { return testPropsAll('flexWrap'); }; tests['touch'] = function() { var bool; if(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) { bool = true; } else { injectElementWithStyles(['@media (',prefixes.join('touch-enabled),('),mod,')','{#modernizr{top:9px;position:absolute}}'].join(''), function( node ) { bool = node.offsetTop === 9; }); } return bool; }; tests['postmessage'] = function() { return !!window.postMessage; }; tests['history'] = function() { return !!(window.history && history.pushState); }; tests['draganddrop'] = function() { var div = document.createElement('div'); return ('draggable' in div) || ('ondragstart' in div && 'ondrop' in div); }; tests['rgba'] = function() { setCss('background-color:rgba(150,255,150,.5)'); return contains(mStyle.backgroundColor, 'rgba'); }; tests['hsla'] = function() { setCss('background-color:hsla(120,40%,100%,.5)'); return contains(mStyle.backgroundColor, 'rgba') || contains(mStyle.backgroundColor, 'hsla'); }; tests['multiplebgs'] = function() { setCss('background:url(https://),url(https://),red url(https://)'); return (/(url\s*\(.*?){3}/).test(mStyle.background); }; tests['backgroundsize'] = function() { return testPropsAll('backgroundSize'); }; tests['borderimage'] = function() { return testPropsAll('borderImage'); }; tests['borderradius'] = function() { return testPropsAll('borderRadius'); }; tests['boxshadow'] = function() { return testPropsAll('boxShadow'); }; tests['textshadow'] = function() { return document.createElement('div').style.textShadow === ''; }; tests['opacity'] = function() { setCssAll('opacity:.55'); return (/^0.55$/).test(mStyle.opacity); }; tests['cssanimations'] = function() { return testPropsAll('animationName'); }; tests['csscolumns'] = function() { return testPropsAll('columnCount'); }; tests['cssgradients'] = function() { var str1 = 'background-image:', str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));', str3 = 'linear-gradient(left top,#9f9, white);'; setCss( (str1 + '-webkit- '.split(' ').join(str2 + str1) + prefixes.join(str3 + str1)).slice(0, -str1.length) ); return contains(mStyle.backgroundImage, 'gradient'); }; tests['cssreflections'] = function() { return testPropsAll('boxReflect'); }; tests['csstransforms'] = function() { return !!testPropsAll('transform'); }; tests['csstransforms3d'] = function() { var ret = !!testPropsAll('perspective'); if ( ret && 'webkitPerspective' in docElement.style ) { injectElementWithStyles('@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}', function( node, rule ) { ret = node.offsetLeft === 9 && node.offsetHeight === 3; }); } return ret; }; tests['csstransitions'] = function() { return testPropsAll('transition'); }; tests['fontface'] = function() { var bool; injectElementWithStyles('@font-face {font-family:"font";src:url("https://")}', function( node, rule ) { var style = document.getElementById('smodernizr'), sheet = style.sheet || style.styleSheet, cssText = sheet ? (sheet.cssRules && sheet.cssRules[0] ? sheet.cssRules[0].cssText : sheet.cssText || '') : ''; bool = /src/i.test(cssText) && cssText.indexOf(rule.split(' ')[0]) === 0; }); return bool; }; tests['generatedcontent'] = function() { var bool; injectElementWithStyles(['#',mod,'{font:0/0 a}#',mod,':after{content:"',smile,'";visibility:hidden;font:3px/1 a}'].join(''), function( node ) { bool = node.offsetHeight >= 3; }); return bool; }; tests['video'] = function() { var elem = document.createElement('video'), bool = false; try { if ( bool = !!elem.canPlayType ) { bool = new Boolean(bool); bool.ogg = elem.canPlayType('video/ogg; codecs="theora"') .replace(/^no$/,''); bool.h264 = elem.canPlayType('video/mp4; codecs="avc1.42E01E"') .replace(/^no$/,''); bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,''); } } catch(e) { } return bool; }; tests['audio'] = function() { var elem = document.createElement('audio'), bool = false; try { if ( bool = !!elem.canPlayType ) { bool = new Boolean(bool); bool.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,''); bool.mp3 = elem.canPlayType('audio/mpeg;') .replace(/^no$/,''); bool.wav = elem.canPlayType('audio/wav; codecs="1"') .replace(/^no$/,''); bool.m4a = ( elem.canPlayType('audio/x-m4a;') || elem.canPlayType('audio/aac;')) .replace(/^no$/,''); } } catch(e) { } return bool; }; tests['localstorage'] = function() { try { localStorage.setItem(mod, mod); localStorage.removeItem(mod); return true; } catch(e) { return false; } }; tests['svg'] = function() { return !!document.createElementNS && !!document.createElementNS(ns.svg, 'svg').createSVGRect; }; tests['inlinesvg'] = function() { var div = document.createElement('div'); div.innerHTML = ''; return (div.firstChild && div.firstChild.namespaceURI) == ns.svg; }; tests['svgclippaths'] = function() { return !!document.createElementNS && /SVGClipPath/.test(toString.call(document.createElementNS(ns.svg, 'clipPath'))); }; for ( var feature in tests ) { if ( hasOwnProp(tests, feature) ) { featureName = feature.toLowerCase(); Modernizr[featureName] = tests[feature](); classes.push((Modernizr[featureName] ? '' : 'no-') + featureName); } } Modernizr.addTest = function ( feature, test ) { if ( typeof feature == 'object' ) { for ( var key in feature ) { if ( hasOwnProp( feature, key ) ) { Modernizr.addTest( key, feature[ key ] ); } } } else { feature = feature.toLowerCase(); if ( Modernizr[feature] !== undefined ) { return Modernizr; } test = typeof test == 'function' ? test() : test; if (typeof enableClasses !== "undefined" && enableClasses) { docElement.className += ' ' + (test ? '' : 'no-') + feature; } Modernizr[feature] = test; } return Modernizr; }; setCss(''); modElem = inputElem = null; Modernizr._version = version; Modernizr._prefixes = prefixes; Modernizr._domPrefixes = domPrefixes; Modernizr._cssomPrefixes = cssomPrefixes; Modernizr.hasEvent = isEventSupported; Modernizr.testProp = function(prop){ return testProps([prop]); }; Modernizr.testAllProps = testPropsAll; Modernizr.testStyles = injectElementWithStyles; Modernizr.prefixed = function(prop, obj, elem){ if(!obj) { return testPropsAll(prop, 'pfx'); } else { return testPropsAll(prop, obj, elem); } }; docElement.className = docElement.className.replace(/(^|\s)no-js(\s|$)/, '$1$2') + (enableClasses ? ' js ' + classes.join(' ') : ''); return Modernizr; })(this, this.document); ; // source --> https://www.moderne-einrichtung.de/wp-content/plugins/affiliate-toolkit-starter/lib/select2/js/select2atkp.min.js?ver=5.6.2 /*! select2atkp 4.0.13 | https://github.com/select2atkp/select2atkp/blob/master/LICENSE.md */ !function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t),t}:n(jQuery)}(function(u){var e=function(){if(u&&u.fn&&u.fn.select2atkp&&u.fn.select2atkp.amd)var e=u.fn.select2atkp.amd;var t,n,r,h,o,s,f,g,m,v,y,_,i,a,b;function w(e,t){return i.call(e,t)}function l(e,t){var n,r,i,o,s,a,l,c,u,d,p,h=t&&t.split("/"),f=y.map,g=f&&f["*"]||{};if(e){for(s=(e=e.split("/")).length-1,y.nodeIdCompat&&b.test(e[s])&&(e[s]=e[s].replace(b,"")),"."===e[0].charAt(0)&&h&&(e=h.slice(0,h.length-1).concat(e)),u=0;u":">",'"':""","'":"'","/":"/"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},i.appendMany=function(e,t){if("1.7"===o.fn.jquery.substr(0,3)){var n=o();o.map(t,function(e){n=n.add(e)}),t=n}e.append(t)},i.__cache={};var n=0;return i.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2atkp-id");return null==t&&(e.id?(t=e.id,e.setAttribute("data-select2atkp-id",t)):(e.setAttribute("data-select2atkp-id",++n),t=n.toString())),t},i.StoreData=function(e,t,n){var r=i.GetUniqueElementId(e);i.__cache[r]||(i.__cache[r]={}),i.__cache[r][t]=n},i.GetData=function(e,t){var n=i.GetUniqueElementId(e);return t?i.__cache[n]&&null!=i.__cache[n][t]?i.__cache[n][t]:o(e).data(t):i.__cache[n]},i.RemoveData=function(e){var t=i.GetUniqueElementId(e);null!=i.__cache[t]&&delete i.__cache[t],e.removeAttribute("data-select2atkp-id")},i}),e.define("select2atkp/results",["jquery","./utils"],function(h,f){function r(e,t,n){this.$element=e,this.data=n,this.options=t,r.__super__.constructor.call(this)}return f.Extend(r,f.Observable),r.prototype.render=function(){var e=h('
    ');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e},r.prototype.clear=function(){this.$results.empty()},r.prototype.displayMessage=function(e){var t=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=h(''),r=this.options.get("translations").get(e.message);n.append(t(r(e.args))),n[0].className+=" select2atkp-results__message",this.$results.append(n)},r.prototype.hideMessages=function(){this.$results.find(".select2atkp-results__message").remove()},r.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n",{class:"select2atkp-results__options select2atkp-results__options--nested"});p.append(l),s.append(a),s.append(p)}else this.template(e,t);return f.StoreData(t,"data",e),t},r.prototype.bind=function(t,e){var l=this,n=t.id+"-results";this.$results.attr("id",n),t.on("results:all",function(e){l.clear(),l.append(e.data),t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("results:append",function(e){l.append(e.data),t.isOpen()&&l.setClasses()}),t.on("query",function(e){l.hideMessages(),l.showLoading(e)}),t.on("select",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("open",function(){l.$results.attr("aria-expanded","true"),l.$results.attr("aria-hidden","false"),l.setClasses(),l.ensureHighlightVisible()}),t.on("close",function(){l.$results.attr("aria-expanded","false"),l.$results.attr("aria-hidden","true"),l.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=l.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=l.getHighlightedResults();if(0!==e.length){var t=f.GetData(e[0],"data");"true"==e.attr("aria-selected")?l.trigger("close",{}):l.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e);if(!(n<=0)){var r=n-1;0===e.length&&(r=0);var i=t.eq(r);i.trigger("mouseenter");var o=l.$results.offset().top,s=i.offset().top,a=l.$results.scrollTop()+(s-o);0===r?l.$results.scrollTop(0):s-o<0&&l.$results.scrollTop(a)}}),t.on("results:next",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e)+1;if(!(n>=t.length)){var r=t.eq(n);r.trigger("mouseenter");var i=l.$results.offset().top+l.$results.outerHeight(!1),o=r.offset().top+r.outerHeight(!1),s=l.$results.scrollTop()+o-i;0===n?l.$results.scrollTop(0):ithis.$results.outerHeight()||o<0)&&this.$results.scrollTop(i)}},r.prototype.template=function(e,t){var n=this.options.get("templateResult"),r=this.options.get("escapeMarkup"),i=n(e,t);null==i?t.style.display="none":"string"==typeof i?t.innerHTML=r(i):h(t).append(i)},r}),e.define("select2atkp/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),e.define("select2atkp/selection/base",["jquery","../utils","../keys"],function(n,r,i){function o(e,t){this.$element=e,this.options=t,o.__super__.constructor.call(this)}return r.Extend(o,r.Observable),o.prototype.render=function(){var e=n('');return this._tabindex=0,null!=r.GetData(this.$element[0],"old-tabindex")?this._tabindex=r.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),e.attr("aria-disabled","false"),this.$selection=e},o.prototype.bind=function(e,t){var n=this,r=e.id+"-results";this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n._handleBlur(e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===i.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",r),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","false"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),n.$selection.trigger("focus"),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex),n.$selection.attr("aria-disabled","false")}),e.on("disable",function(){n.$selection.attr("tabindex","-1"),n.$selection.attr("aria-disabled","true")})},o.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||n.contains(t.$selection[0],document.activeElement)||t.trigger("blur",e)},1)},o.prototype._attachCloseHandler=function(e){n(document.body).on("mousedown.select2atkp."+e.id,function(e){var t=n(e.target).closest(".select2atkp");n(".select2atkp.select2atkp-container--open").each(function(){this!=t[0]&&r.GetData(this,"element").select2atkp("close")})})},o.prototype._detachCloseHandler=function(e){n(document.body).off("mousedown.select2atkp."+e.id)},o.prototype.position=function(e,t){t.find(".selection").append(e)},o.prototype.destroy=function(){this._detachCloseHandler(this.container)},o.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},o.prototype.isEnabled=function(){return!this.isDisabled()},o.prototype.isDisabled=function(){return this.options.get("disabled")},o}),e.define("select2atkp/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,r){function i(){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e.addClass("select2atkp-selection--single"),e.html(''),e},i.prototype.bind=function(t,e){var n=this;i.__super__.bind.apply(this,arguments);var r=t.id+"-container";this.$selection.find(".select2atkp-selection__rendered").attr("id",r).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",r),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),t.on("focus",function(e){t.isOpen()||n.$selection.trigger("focus")})},i.prototype.clear=function(){var e=this.$selection.find(".select2atkp-selection__rendered");e.empty(),e.removeAttr("title")},i.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},i.prototype.selectionContainer=function(){return e("")},i.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2atkp-selection__rendered"),r=this.display(t,n);n.empty().append(r);var i=t.title||t.text;i?n.attr("title",i):n.removeAttr("title")}else this.clear()},i}),e.define("select2atkp/selection/multiple",["jquery","./base","../utils"],function(i,e,l){function n(e,t){n.__super__.constructor.apply(this,arguments)}return l.Extend(n,e),n.prototype.render=function(){var e=n.__super__.render.call(this);return e.addClass("select2atkp-selection--multiple"),e.html('
      '),e},n.prototype.bind=function(e,t){var r=this;n.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){r.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2atkp-selection__choice__remove",function(e){if(!r.isDisabled()){var t=i(this).parent(),n=l.GetData(t[0],"data");r.trigger("unselect",{originalEvent:e,data:n})}})},n.prototype.clear=function(){var e=this.$selection.find(".select2atkp-selection__rendered");e.empty(),e.removeAttr("title")},n.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},n.prototype.selectionContainer=function(){return i('
    • ×
    • ')},n.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=0;n×');a.StoreData(r[0],"data",t),this.$selection.find(".select2atkp-selection__rendered").prepend(r)}},e}),e.define("select2atkp/selection/search",["jquery","../utils","../keys"],function(r,a,l){function e(e,t,n){e.call(this,t,n)}return e.prototype.render=function(e){var t=r('');this.$searchContainer=t,this.$search=t.find("input");var n=e.call(this);return this._transferTabIndex(),n},e.prototype.bind=function(e,t,n){var r=this,i=t.id+"-results";e.call(this,t,n),t.on("open",function(){r.$search.attr("aria-controls",i),r.$search.trigger("focus")}),t.on("close",function(){r.$search.val(""),r.$search.removeAttr("aria-controls"),r.$search.removeAttr("aria-activedescendant"),r.$search.trigger("focus")}),t.on("enable",function(){r.$search.prop("disabled",!1),r._transferTabIndex()}),t.on("disable",function(){r.$search.prop("disabled",!0)}),t.on("focus",function(e){r.$search.trigger("focus")}),t.on("results:focus",function(e){e.data._resultId?r.$search.attr("aria-activedescendant",e.data._resultId):r.$search.removeAttr("aria-activedescendant")}),this.$selection.on("focusin",".select2atkp-search--inline",function(e){r.trigger("focus",e)}),this.$selection.on("focusout",".select2atkp-search--inline",function(e){r._handleBlur(e)}),this.$selection.on("keydown",".select2atkp-search--inline",function(e){if(e.stopPropagation(),r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented(),e.which===l.BACKSPACE&&""===r.$search.val()){var t=r.$searchContainer.prev(".select2atkp-selection__choice");if(0this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2atkp/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("select",function(){r._checkIfMaximumSelected()})},e.prototype.query=function(e,t,n){var r=this;this._checkIfMaximumSelected(function(){e.call(r,t,n)})},e.prototype._checkIfMaximumSelected=function(e,n){var r=this;this.current(function(e){var t=null!=e?e.length:0;0=r.maximumSelectionLength?r.trigger("results:message",{message:"maximumSelected",args:{maximum:r.maximumSelectionLength}}):n&&n()})},e}),e.define("select2atkp/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),e.define("select2atkp/dropdown/search",["jquery","../utils"],function(o,e){function t(){}return t.prototype.render=function(e){var t=e.call(this),n=o('');return this.$searchContainer=n,this.$search=n.find("input"),t.prepend(n),t},t.prototype.bind=function(e,t,n){var r=this,i=t.id+"-results";e.call(this,t,n),this.$search.on("keydown",function(e){r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){o(this).off("keyup")}),this.$search.on("keyup input",function(e){r.handleSearch(e)}),t.on("open",function(){r.$search.attr("tabindex",0),r.$search.attr("aria-controls",i),r.$search.trigger("focus"),window.setTimeout(function(){r.$search.trigger("focus")},0)}),t.on("close",function(){r.$search.attr("tabindex",-1),r.$search.removeAttr("aria-controls"),r.$search.removeAttr("aria-activedescendant"),r.$search.val(""),r.$search.trigger("blur")}),t.on("focus",function(){t.isOpen()||r.$search.trigger("focus")}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(r.showSearch(e)?r.$searchContainer.removeClass("select2atkp-search--hide"):r.$searchContainer.addClass("select2atkp-search--hide"))}),t.on("results:focus",function(e){e.data._resultId?r.$search.attr("aria-activedescendant",e.data._resultId):r.$search.removeAttr("aria-activedescendant")})},t.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},t.prototype.showSearch=function(e,t){return!0},t}),e.define("select2atkp/dropdown/hidePlaceholder",[],function(){function e(e,t,n,r){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,r)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),r=t.length-1;0<=r;r--){var i=t[r];this.placeholder.id===i.id&&n.splice(r,1)}return n},e}),e.define("select2atkp/dropdown/infiniteScroll",["jquery"],function(n){function e(e,t,n,r){this.lastParams={},e.call(this,t,n,r),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("query",function(e){r.lastParams=e,r.loading=!0}),t.on("query:append",function(e){r.lastParams=e,r.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=n.contains(document.documentElement,this.$loadingMore[0]);if(!this.loading&&e){var t=this.$results.offset().top+this.$results.outerHeight(!1);this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=t+50&&this.loadMore()}},e.prototype.loadMore=function(){this.loading=!0;var e=n.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=n('
    • '),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),e.define("select2atkp/dropdown/attachBody",["jquery","../utils"],function(f,a){function e(e,t,n){this.$dropdownParent=f(n.get("dropdownParent")||document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("open",function(){r._showDropdown(),r._attachPositioningHandler(t),r._bindContainerResultHandlers(t)}),t.on("close",function(){r._hideDropdown(),r._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2atkp"),t.addClass("select2atkp-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=f(""),n=e.call(this);return t.append(n),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._bindContainerResultHandlers=function(e,t){if(!this._containerResultsHandlersBound){var n=this;t.on("results:all",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:append",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:message",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("select",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("unselect",function(){n._positionDropdown(),n._resizeDropdown()}),this._containerResultsHandlersBound=!0}},e.prototype._attachPositioningHandler=function(e,t){var n=this,r="scroll.select2atkp."+t.id,i="resize.select2atkp."+t.id,o="orientationchange.select2atkp."+t.id,s=this.$container.parents().filter(a.hasScroll);s.each(function(){a.StoreData(this,"select2atkp-scroll-position",{x:f(this).scrollLeft(),y:f(this).scrollTop()})}),s.on(r,function(e){var t=a.GetData(this,"select2atkp-scroll-position");f(this).scrollTop(t.y)}),f(window).on(r+" "+i+" "+o,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2atkp."+t.id,r="resize.select2atkp."+t.id,i="orientationchange.select2atkp."+t.id;this.$container.parents().filter(a.hasScroll).off(n),f(window).off(n+" "+r+" "+i)},e.prototype._positionDropdown=function(){var e=f(window),t=this.$dropdown.hasClass("select2atkp-dropdown--above"),n=this.$dropdown.hasClass("select2atkp-dropdown--below"),r=null,i=this.$container.offset();i.bottom=i.top+this.$container.outerHeight(!1);var o={height:this.$container.outerHeight(!1)};o.top=i.top,o.bottom=i.top+o.height;var s=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=ai.bottom+s,d={left:i.left,top:o.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h={top:0,left:0};(f.contains(document.body,p[0])||p[0].isConnected)&&(h=p.offset()),d.top-=h.top,d.left-=h.left,t||n||(r="below"),u||!c||t?!c&&u&&t&&(r="below"):r="above",("above"==r||t&&"below"!==r)&&(d.top=o.top-h.top-s),null!=r&&(this.$dropdown.removeClass("select2atkp-dropdown--below select2atkp-dropdown--above").addClass("select2atkp-dropdown--"+r),this.$container.removeClass("select2atkp-container--below select2atkp-container--above").addClass("select2atkp-container--"+r)),this.$dropdownContainer.css(d)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),e.define("select2atkp/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,r){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,r)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,r=0;r');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2atkp-container--"+this.options.get("theme")),u.StoreData(e[0],"element",this.$element),e},d}),e.define("jquery-mousewheel",["jquery"],function(e){return e}),e.define("jquery.select2atkp",["jquery","jquery-mousewheel","./select2atkp/core","./select2atkp/defaults","./select2atkp/utils"],function(i,e,o,t,s){if(null==i.fn.select2atkp){var a=["open","close","destroy"];i.fn.select2atkp=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var e=i.extend(!0,{},t);new o(i(this),e)}),this;if("string"!=typeof t)throw new Error("Invalid arguments for select2atkp: "+t);var n,r=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=s.GetData(this,"select2atkp");null==e&&window.console&&console.error&&console.error("The select2atkp('"+t+"') method was called on an element that is not using select2atkp."),n=e[t].apply(e,r)}),-1 https://www.moderne-einrichtung.de/wp-content/plugins/affiliate-toolkit-starter/js/library.js?ver=5.6.2 var offsetx = 20; var offsety = 0; function hideAtkpBox(e, Inhalte) { document.getElementById('atkp-infobox').style.visibility = "hidden"; } function showAtkpBox(e, Inhalte, offsetX, offsetY) { if (offsetX) { offsetx = offsetX; } else { offsetx = 20; } if (offsetY) { offsety = offsetY; } else { offsety = 0; } var PositionX = 0; var PositionY = 0; if (!e) var e = window.event; if (e.pageX || e.pageY) { PositionX = e.pageX; PositionY = e.pageY; } else if (e.clientX || e.clientY) { PositionX = e.clientX + document.body.scrollLeft; PositionY = e.clientY + document.body.scrollTop; } document.getElementById("BoxInhalte").innerHTML = document.getElementById(Inhalte).innerHTML; document.getElementById('atkp-infobox').style.left = (PositionX + offsetx) + "px"; document.getElementById('atkp-infobox').style.top = (PositionY + offsety) + "px"; document.getElementById('atkp-infobox').style.visibility = "visible"; } function atkp_open_link(link, mode, trackingtype, linktype, linkcaption) { if (trackingtype == 1 && typeof ga !== "undefined") ga('send', 'event', linktype, 'click', linkcaption); else if (trackingtype == 2 && typeof _gaq !== "undefined") _gaq.push(['_trackEvent', linktype, 'click', linkcaption]); else if (trackingtype == 3 && typeof gtag !== "undefined") gtag('event', linktype, {'event_category': 'click', 'event_label': linkcaption}); window.open(link, mode); } /*slider*/ /*! nouislider - 9.0.0 - 2016-09-29 21:44:02 */ !function (a) { "function" == typeof define && define.amd ? define([], a) : "object" == typeof exports ? module.exports = a() : window.atkpnoUiSlider = a() }(function () { "use strict"; function a(a, b) { var c = document.createElement("div"); return j(c, b), a.appendChild(c), c } function b(a) { return a.filter(function (a) { return !this[a] && (this[a] = !0) }, {}) } function c(a, b) { return Math.round(a / b) * b } function d(a, b) { var c = a.getBoundingClientRect(), d = a.ownerDocument, e = d.documentElement, f = m(); return /webkit.*Chrome.*Mobile/i.test(navigator.userAgent) && (f.x = 0), b ? c.top + f.y - e.clientTop : c.left + f.x - e.clientLeft } function e(a) { return "number" == typeof a && !isNaN(a) && isFinite(a) } function f(a, b, c) { c > 0 && (j(a, b), setTimeout(function () { k(a, b) }, c)) } function g(a) { return Math.max(Math.min(a, 100), 0) } function h(a) { return Array.isArray(a) ? a : [a] } function i(a) { a = String(a); var b = a.split("."); return b.length > 1 ? b[1].length : 0 } function j(a, b) { a.classList ? a.classList.add(b) : a.className += " " + b } function k(a, b) { a.classList ? a.classList.remove(b) : a.className = a.className.replace(new RegExp("(^|\\b)" + b.split(" ").join("|") + "(\\b|$)", "gi"), " ") } function l(a, b) { return a.classList ? a.classList.contains(b) : new RegExp("\\b" + b + "\\b").test(a.className) } function m() { var a = void 0 !== window.pageXOffset, b = "CSS1Compat" === (document.compatMode || ""), c = a ? window.pageXOffset : b ? document.documentElement.scrollLeft : document.body.scrollLeft, d = a ? window.pageYOffset : b ? document.documentElement.scrollTop : document.body.scrollTop; return {x: c, y: d} } function n() { return window.navigator.pointerEnabled ? { start: "pointerdown", move: "pointermove", end: "pointerup" } : window.navigator.msPointerEnabled ? { start: "MSPointerDown", move: "MSPointerMove", end: "MSPointerUp" } : {start: "mousedown touchstart", move: "mousemove touchmove", end: "mouseup touchend"} } function o(a, b) { return 100 / (b - a) } function p(a, b) { return 100 * b / (a[1] - a[0]) } function q(a, b) { return p(a, a[0] < 0 ? b + Math.abs(a[0]) : b - a[0]) } function r(a, b) { return b * (a[1] - a[0]) / 100 + a[0] } function s(a, b) { for (var c = 1; a >= b[c];) c += 1; return c } function t(a, b, c) { if (c >= a.slice(-1)[0]) return 100; var d, e, f, g, h = s(c, a); return d = a[h - 1], e = a[h], f = b[h - 1], g = b[h], f + q([d, e], c) / o(f, g) } function u(a, b, c) { if (c >= 100) return a.slice(-1)[0]; var d, e, f, g, h = s(c, b); return d = a[h - 1], e = a[h], f = b[h - 1], g = b[h], r([d, e], (c - f) * o(f, g)) } function v(a, b, d, e) { if (100 === e) return e; var f, g, h = s(e, a); return d ? (f = a[h - 1], g = a[h], e - f > (g - f) / 2 ? g : f) : b[h - 1] ? a[h - 1] + c(e - a[h - 1], b[h - 1]) : e } function w(a, b, c) { var d; if ("number" == typeof b && (b = [b]), "[object Array]" !== Object.prototype.toString.call(b)) throw new Error("atkpnoUiSlider: 'range' contains invalid value."); if (d = "min" === a ? 0 : "max" === a ? 100 : parseFloat(a), !e(d) || !e(b[0])) throw new Error("atkpnoUiSlider: 'range' value isn't numeric."); c.xPct.push(d), c.xVal.push(b[0]), d ? c.xSteps.push(!isNaN(b[1]) && b[1]) : isNaN(b[1]) || (c.xSteps[0] = b[1]), c.xHighestCompleteStep.push(0) } function x(a, b, c) { if (!b) return !0; c.xSteps[a] = p([c.xVal[a], c.xVal[a + 1]], b) / o(c.xPct[a], c.xPct[a + 1]); var d = (c.xVal[a + 1] - c.xVal[a]) / c.xNumSteps[a], e = Math.ceil(Number(d.toFixed(3)) - 1), f = c.xVal[a] + c.xNumSteps[a] * e; c.xHighestCompleteStep[a] = f } function y(a, b, c, d) { this.xPct = [], this.xVal = [], this.xSteps = [d || !1], this.xNumSteps = [!1], this.xHighestCompleteStep = [], this.snap = b, this.direction = c; var e, f = []; for (e in a) a.hasOwnProperty(e) && f.push([a[e], e]); for (f.length && "object" == typeof f[0][0] ? f.sort(function (a, b) { return a[0][0] - b[0][0] }) : f.sort(function (a, b) { return a[0] - b[0] }), e = 0; e < f.length; e++) w(f[e][1], f[e][0], this); for (this.xNumSteps = this.xSteps.slice(0), e = 0; e < this.xNumSteps.length; e++) x(e, this.xNumSteps[e], this) } function z(a, b) { if (!e(b)) throw new Error("atkpnoUiSlider: 'step' is not numeric."); a.singleStep = b } function A(a, b) { if ("object" != typeof b || Array.isArray(b)) throw new Error("atkpnoUiSlider: 'range' is not an object."); if (void 0 === b.min || void 0 === b.max) throw new Error("atkpnoUiSlider: Missing 'min' or 'max' in 'range'."); if (b.min === b.max) throw new Error("atkpnoUiSlider: 'range' 'min' and 'max' cannot be equal."); a.spectrum = new y(b, a.snap, a.dir, a.singleStep) } function B(a, b) { if (b = h(b), !Array.isArray(b) || !b.length) throw new Error("atkpnoUiSlider: 'start' option is incorrect."); a.handles = b.length, a.start = b } function C(a, b) { if (a.snap = b, "boolean" != typeof b) throw new Error("atkpnoUiSlider: 'snap' option must be a boolean.") } function D(a, b) { if (a.animate = b, "boolean" != typeof b) throw new Error("atkpnoUiSlider: 'animate' option must be a boolean.") } function E(a, b) { if (a.animationDuration = b, "number" != typeof b) throw new Error("atkpnoUiSlider: 'animationDuration' option must be a number.") } function F(a, b) { var c, d = [!1]; if (b === !0 || b === !1) { for (c = 1; c < a.handles; c++) d.push(b); d.push(!1) } else { if (!Array.isArray(b) || !b.length || b.length !== a.handles + 1) throw new Error("atkpnoUiSlider: 'connect' option doesn't match handle count."); d = b } a.connect = d } function G(a, b) { switch (b) { case"horizontal": a.ort = 0; break; case"vertical": a.ort = 1; break; default: throw new Error("atkpnoUiSlider: 'orientation' option is invalid.") } } function H(a, b) { if (!e(b)) throw new Error("atkpnoUiSlider: 'margin' option must be numeric."); if (0 !== b && (a.margin = a.spectrum.getMargin(b), !a.margin)) throw new Error("atkpnoUiSlider: 'margin' option is only supported on linear sliders.") } function I(a, b) { if (!e(b)) throw new Error("atkpnoUiSlider: 'limit' option must be numeric."); if (a.limit = a.spectrum.getMargin(b), !a.limit || a.handles < 2) throw new Error("atkpnoUiSlider: 'limit' option is only supported on linear sliders with 2 or more handles.") } function J(a, b) { switch (b) { case"ltr": a.dir = 0; break; case"rtl": a.dir = 1; break; default: throw new Error("atkpnoUiSlider: 'direction' option was not recognized.") } } function K(a, b) { if ("string" != typeof b) throw new Error("atkpnoUiSlider: 'behaviour' must be a string containing options."); var c = b.indexOf("tap") >= 0, d = b.indexOf("drag") >= 0, e = b.indexOf("fixed") >= 0, f = b.indexOf("snap") >= 0, g = b.indexOf("hover") >= 0; if (e) { if (2 !== a.handles) throw new Error("atkpnoUiSlider: 'fixed' behaviour must be used with 2 handles"); H(a, a.start[1] - a.start[0]) } a.events = {tap: c || f, drag: d, fixed: e, snap: f, hover: g} } function L(a, b) { if (b !== !1) if (b === !0) { a.tooltips = []; for (var c = 0; c < a.handles; c++) a.tooltips.push(!0) } else { if (a.tooltips = h(b), a.tooltips.length !== a.handles) throw new Error("atkpnoUiSlider: must pass a formatter for all handles."); a.tooltips.forEach(function (a) { if ("boolean" != typeof a && ("object" != typeof a || "function" != typeof a.to)) throw new Error("atkpnoUiSlider: 'tooltips' must be passed a formatter or 'false'.") }) } } function M(a, b) { if (a.format = b, "function" == typeof b.to && "function" == typeof b.from) return !0; throw new Error("atkpnoUiSlider: 'format' requires 'to' and 'from' methods.") } function N(a, b) { if (void 0 !== b && "string" != typeof b && b !== !1) throw new Error("atkpnoUiSlider: 'cssPrefix' must be a string or `false`."); a.cssPrefix = b } function O(a, b) { if (void 0 !== b && "object" != typeof b) throw new Error("atkpnoUiSlider: 'cssClasses' must be an object."); if ("string" == typeof a.cssPrefix) { a.cssClasses = {}; for (var c in b) b.hasOwnProperty(c) && (a.cssClasses[c] = a.cssPrefix + b[c]) } else a.cssClasses = b } function P(a, b) { if (b !== !0 && b !== !1) throw new Error("atkpnoUiSlider: 'useRequestAnimationFrame' option should be true (default) or false."); a.useRequestAnimationFrame = b } function Q(a) { var b, c = {margin: 0, limit: 0, animate: !0, animationDuration: 300, format: T}; b = { step: {r: !1, t: z}, start: {r: !0, t: B}, connect: {r: !0, t: F}, direction: {r: !0, t: J}, snap: {r: !1, t: C}, animate: {r: !1, t: D}, animationDuration: {r: !1, t: E}, range: {r: !0, t: A}, orientation: {r: !1, t: G}, margin: {r: !1, t: H}, limit: {r: !1, t: I}, behaviour: {r: !0, t: K}, format: {r: !1, t: M}, tooltips: {r: !1, t: L}, cssPrefix: {r: !1, t: N}, cssClasses: {r: !1, t: O}, useRequestAnimationFrame: {r: !1, t: P} }; var d = { connect: !1, direction: "ltr", behaviour: "tap", orientation: "horizontal", cssPrefix: "atkpnoUi-", cssClasses: { target: "target", base: "base", origin: "origin", handle: "handle", horizontal: "horizontal", vertical: "vertical", background: "background", connect: "connect", ltr: "ltr", rtl: "rtl", draggable: "draggable", drag: "state-drag", tap: "state-tap", active: "active", tooltip: "tooltip", pips: "pips", pipsHorizontal: "pips-horizontal", pipsVertical: "pips-vertical", marker: "marker", markerHorizontal: "marker-horizontal", markerVertical: "marker-vertical", markerNormal: "marker-normal", markerLarge: "marker-large", markerSub: "marker-sub", value: "value", valueHorizontal: "value-horizontal", valueVertical: "value-vertical", valueNormal: "value-normal", valueLarge: "value-large", valueSub: "value-sub" }, useRequestAnimationFrame: !0 }; Object.keys(b).forEach(function (e) { if (void 0 === a[e] && void 0 === d[e]) { if (b[e].r) throw new Error("atkpnoUiSlider: '" + e + "' is required."); return !0 } b[e].t(c, void 0 === a[e] ? d[e] : a[e]) }), c.pips = a.pips; var e = [["left", "top"], ["right", "bottom"]]; return c.style = e[c.dir][c.ort], c.styleOposite = e[c.dir ? 0 : 1][c.ort], c } function R(c, e, i) { function o(b, c) { var d = a(b, e.cssClasses.origin), f = a(d, e.cssClasses.handle); return f.setAttribute("data-handle", c), d } function p(b, c) { return !!c && a(b, e.cssClasses.connect) } function q(a, b) { ba = [], ca = [], ca.push(p(b, a[0])); for (var c = 0; c < e.handles; c++) ba.push(o(b, c)), ha[c] = c, ca.push(p(b, a[c + 1])) } function r(b) { j(b, e.cssClasses.target), 0 === e.dir ? j(b, e.cssClasses.ltr) : j(b, e.cssClasses.rtl), 0 === e.ort ? j(b, e.cssClasses.horizontal) : j(b, e.cssClasses.vertical), aa = a(b, e.cssClasses.base) } function s(b, c) { return !!e.tooltips[c] && a(b.firstChild, e.cssClasses.tooltip) } function t() { var a = ba.map(s); Z("update", function (b, c, d) { if (a[c]) { var f = b[c]; e.tooltips[c] !== !0 && (f = e.tooltips[c].to(d[c])), a[c].innerHTML = f } }) } function u(a, b, c) { if ("range" === a || "steps" === a) return ia.xVal; if ("count" === a) { var d, e = 100 / (b - 1), f = 0; for (b = []; (d = f++ * e) <= 100;) b.push(d); a = "positions" } return "positions" === a ? b.map(function (a) { return ia.fromStepping(c ? ia.getStep(a) : a) }) : "values" === a ? c ? b.map(function (a) { return ia.fromStepping(ia.getStep(ia.toStepping(a))) }) : b : void 0 } function v(a, c, d) { function e(a, b) { return (a + b).toFixed(7) / 1 } var f = {}, g = ia.xVal[0], h = ia.xVal[ia.xVal.length - 1], i = !1, j = !1, k = 0; return d = b(d.slice().sort(function (a, b) { return a - b })), d[0] !== g && (d.unshift(g), i = !0), d[d.length - 1] !== h && (d.push(h), j = !0), d.forEach(function (b, g) { var h, l, m, n, o, p, q, r, s, t, u = b, v = d[g + 1]; if ("steps" === c && (h = ia.xNumSteps[g]), h || (h = v - u), u !== !1 && void 0 !== v) for (h = Math.max(h, 1e-7), l = u; l <= v; l = e(l, h)) { for (n = ia.toStepping(l), o = n - k, r = o / a, s = Math.round(r), t = o / s, m = 1; m <= s; m += 1) p = k + m * t, f[p.toFixed(5)] = ["x", 0]; q = d.indexOf(l) > -1 ? 1 : "steps" === c ? 2 : 0, !g && i && (q = 0), l === v && j || (f[n.toFixed(5)] = [l, q]), k = n } }), f } function w(a, b, c) { function d(a, b) { var c = b === e.cssClasses.value, d = c ? m : n, f = c ? k : l; return b + " " + d[e.ort] + " " + f[a] } function f(a, b, c) { return 'class="' + d(c[1], b) + '" style="' + e.style + ": " + a + '%"' } function g(a, d) { d[1] = d[1] && b ? b(d[0], d[1]) : d[1], i += "
      ", d[1] && (i += "
      " + c.to(d[0]) + "
      ") } var h = document.createElement("div"), i = "", k = [e.cssClasses.valueNormal, e.cssClasses.valueLarge, e.cssClasses.valueSub], l = [e.cssClasses.markerNormal, e.cssClasses.markerLarge, e.cssClasses.markerSub], m = [e.cssClasses.valueHorizontal, e.cssClasses.valueVertical], n = [e.cssClasses.markerHorizontal, e.cssClasses.markerVertical]; return j(h, e.cssClasses.pips), j(h, 0 === e.ort ? e.cssClasses.pipsHorizontal : e.cssClasses.pipsVertical), Object.keys(a).forEach(function (b) { g(b, a[b]) }), h.innerHTML = i, h } function x(a) { var b = a.mode, c = a.density || 1, d = a.filter || !1, e = a.values || !1, f = a.stepped || !1, g = u(b, e, f), h = v(c, b, g), i = a.format || {to: Math.round}; return fa.appendChild(w(h, d, i)) } function y() { var a = aa.getBoundingClientRect(), b = "offset" + ["Width", "Height"][e.ort]; return 0 === e.ort ? a.width || aa[b] : a.height || aa[b] } function z(a, b, c, d) { var f = function (b) { return !fa.hasAttribute("disabled") && (!l(fa, e.cssClasses.tap) && (b = A(b, d.pageOffset), !(a === ea.start && void 0 !== b.buttons && b.buttons > 1) && ((!d.hover || !b.buttons) && (b.calcPoint = b.points[e.ort], void c(b, d))))) }, g = []; return a.split(" ").forEach(function (a) { b.addEventListener(a, f, !1), g.push([a, f]) }), g } function A(a, b) { a.preventDefault(); var c, d, e = 0 === a.type.indexOf("touch"), f = 0 === a.type.indexOf("mouse"), g = 0 === a.type.indexOf("pointer"), h = a; if (0 === a.type.indexOf("MSPointer") && (g = !0), e) { if (h.touches.length > 1) return !1; c = a.changedTouches[0].pageX, d = a.changedTouches[0].pageY } return b = b || m(), (f || g) && (c = a.clientX + b.x, d = a.clientY + b.y), h.pageOffset = b, h.points = [c, d], h.cursor = f || g, h } function B(a) { var b = a - d(aa, e.ort), c = 100 * b / y(); return e.dir ? 100 - c : c } function C(a) { var b = 100, c = !1; return ba.forEach(function (d, e) { if (!d.hasAttribute("disabled")) { var f = Math.abs(ga[e] - a); f < b && (c = e, b = f) } }), c } function D(a, b, c, d) { var e = c.slice(), f = [!a, a], g = [a, !a]; d = d.slice(), a && d.reverse(), d.length > 1 ? d.forEach(function (a, c) { var d = M(e, a, e[a] + b, f[c], g[c]); d === !1 ? b = 0 : (b = d - e[a], e[a] = d) }) : f = g = [!0]; var h = !1; d.forEach(function (a, d) { h = R(a, c[a] + b, f[d], g[d]) || h }), h && d.forEach(function (a) { E("update", a), E("slide", a) }) } function E(a, b, c) { Object.keys(ka).forEach(function (d) { var f = d.split(".")[0]; a === f && ka[d].forEach(function (a) { a.call(da, ja.map(e.format.to), b, ja.slice(), c || !1, ga.slice()) }) }) } function F(a, b) { "mouseout" === a.type && "HTML" === a.target.nodeName && null === a.relatedTarget && H(a, b) } function G(a, b) { if (navigator.appVersion.indexOf("MSIE 9") === -1 && 0 === a.buttons && 0 !== b.buttonsProperty) return H(a, b); var c = (e.dir ? -1 : 1) * (a.calcPoint - b.startCalcPoint), d = 100 * c / b.baseSize; D(c > 0, d, b.locations, b.handleNumbers) } function H(a, b) { var c = aa.querySelector("." + e.cssClasses.active); null !== c && k(c, e.cssClasses.active), a.cursor && (document.body.style.cursor = "", document.body.removeEventListener("selectstart", document.body.atkpnoUiListener)), document.documentElement.atkpnoUiListeners.forEach(function (a) { document.documentElement.removeEventListener(a[0], a[1]) }), k(fa, e.cssClasses.drag), P(), b.handleNumbers.forEach(function (a) { E("set", a), E("change", a), E("end", a) }) } function I(a, b) { if (1 === b.handleNumbers.length) { var c = ba[b.handleNumbers[0]]; if (c.hasAttribute("disabled")) return !1; j(c.children[0], e.cssClasses.active) } a.preventDefault(), a.stopPropagation(); var d = z(ea.move, document.documentElement, G, { startCalcPoint: a.calcPoint, baseSize: y(), pageOffset: a.pageOffset, handleNumbers: b.handleNumbers, buttonsProperty: a.buttons, locations: ga.slice() }), f = z(ea.end, document.documentElement, H, {handleNumbers: b.handleNumbers}), g = z("mouseout", document.documentElement, F, {handleNumbers: b.handleNumbers}); if (document.documentElement.atkpnoUiListeners = d.concat(f, g), a.cursor) { document.body.style.cursor = getComputedStyle(a.target).cursor, ba.length > 1 && j(fa, e.cssClasses.drag); var h = function () { return !1 }; document.body.atkpnoUiListener = h, document.body.addEventListener("selectstart", h, !1) } b.handleNumbers.forEach(function (a) { E("start", a) }) } function J(a) { a.stopPropagation(); var b = B(a.calcPoint), c = C(b); return c !== !1 && (e.events.snap || f(fa, e.cssClasses.tap, e.animationDuration), R(c, b, !0, !0), P(), E("slide", c, !0), E("set", c, !0), E("change", c, !0), E("update", c, !0), void(e.events.snap && I(a, {handleNumbers: [c]}))) } function K(a) { var b = B(a.calcPoint), c = ia.getStep(b), d = ia.fromStepping(c); Object.keys(ka).forEach(function (a) { "hover" === a.split(".")[0] && ka[a].forEach(function (a) { a.call(da, d) }) }) } function L(a) { a.fixed || ba.forEach(function (a, b) { z(ea.start, a.children[0], I, {handleNumbers: [b]}) }), a.tap && z(ea.start, aa, J, {}), a.hover && z(ea.move, aa, K, {hover: !0}), a.drag && ca.forEach(function (b, c) { if (b !== !1 && 0 !== c && c !== ca.length - 1) { var d = ba[c - 1], f = ba[c], g = [b]; j(b, e.cssClasses.draggable), a.fixed && (g.push(d.children[0]), g.push(f.children[0])), g.forEach(function (a) { z(ea.start, a, I, {handles: [d, f], handleNumbers: [c - 1, c]}) }) } }) } function M(a, b, c, d, f) { return ba.length > 1 && (d && b > 0 && (c = Math.max(c, a[b - 1] + e.margin)), f && b < ba.length - 1 && (c = Math.min(c, a[b + 1] - e.margin))), ba.length > 1 && e.limit && (d && b > 0 && (c = Math.min(c, a[b - 1] + e.limit)), f && b < ba.length - 1 && (c = Math.max(c, a[b + 1] - e.limit))), c = ia.getStep(c), c = g(c), c !== a[b] && c } function N(a) { return a + "%" } function O(a, b) { ga[a] = b, ja[a] = ia.fromStepping(b); var c = function () { ba[a].style[e.style] = N(b), S(a), S(a + 1) }; window.requestAnimationFrame && e.useRequestAnimationFrame ? window.requestAnimationFrame(c) : c() } function P() { ha.forEach(function (a) { var b = ga[a] > 50 ? -1 : 1, c = 3 + (ba.length + b * a); ba[a].childNodes[0].style.zIndex = c }) } function R(a, b, c, d) { return b = M(ga, a, b, c, d), b !== !1 && (O(a, b), !0) } function S(a) { if (ca[a]) { var b = 0, c = 100; 0 !== a && (b = ga[a - 1]), a !== ca.length - 1 && (c = ga[a]), ca[a].style[e.style] = N(b), ca[a].style[e.styleOposite] = N(100 - c) } } function T(a, b) { null !== a && a !== !1 && ("number" == typeof a && (a = String(a)), a = e.format.from(a), a === !1 || isNaN(a) || R(b, ia.toStepping(a), !1, !1)) } function U(a, b) { var c = h(a), d = void 0 === ga[0]; b = void 0 === b || !!b, c.forEach(T), e.animate && !d && f(fa, e.cssClasses.tap, e.animationDuration), ha.forEach(function (a) { R(a, ga[a], !0, !1) }), P(), ha.forEach(function (a) { E("update", a), null !== c[a] && b && E("set", a) }) } function V(a) { U(e.start, a) } function W() { var a = ja.map(e.format.to); return 1 === a.length ? a[0] : a } function X() { for (var a in e.cssClasses) e.cssClasses.hasOwnProperty(a) && k(fa, e.cssClasses[a]); for (; fa.firstChild;) fa.removeChild(fa.firstChild); delete fa.atkpnoUiSlider } function Y() { return ga.map(function (a, b) { var c = ia.getNearbySteps(a), d = ja[b], e = c.thisStep.step, f = null; e !== !1 && d + e > c.stepAfter.startValue && (e = c.stepAfter.startValue - d), f = d > c.thisStep.startValue ? c.thisStep.step : c.stepBefore.step !== !1 && d - c.stepBefore.highestStep, 100 === a ? e = null : 0 === a && (f = null); var g = ia.countStepDecimals(); return null !== e && e !== !1 && (e = Number(e.toFixed(g))), null !== f && f !== !1 && (f = Number(f.toFixed(g))), [f, e] }) } function Z(a, b) { ka[a] = ka[a] || [], ka[a].push(b), "update" === a.split(".")[0] && ba.forEach(function (a, b) { E("update", b) }) } function $(a) { var b = a && a.split(".")[0], c = b && a.substring(b.length); Object.keys(ka).forEach(function (a) { var d = a.split(".")[0], e = a.substring(d.length); b && b !== d || c && c !== e || delete ka[a] }) } function _(a, b) { var c = W(), d = ["margin", "limit", "range", "animate", "snap", "step", "format"]; d.forEach(function (b) { void 0 !== a[b] && (i[b] = a[b]) }); var f = Q(i); d.forEach(function (b) { void 0 !== a[b] && (e[b] = f[b]) }), f.spectrum.direction = ia.direction, ia = f.spectrum, e.margin = f.margin, e.limit = f.limit, ga = [], U(a.start || c, b) } var aa, ba, ca, da, ea = n(), fa = c, ga = [], ha = [], ia = e.spectrum, ja = [], ka = {}; if (fa.atkpnoUiSlider) throw new Error("Slider was already initialized."); return r(fa), q(e.connect, aa), da = { destroy: X, steps: Y, on: Z, off: $, get: W, set: U, reset: V, __moveHandles: function (a, b, c) { D(a, b, ga, c) }, options: i, updateOptions: _, target: fa, pips: x }, L(e.events), U(e.start), e.pips && x(e.pips), e.tooltips && t(), da } function S(a, b) { if (!a.nodeName) throw new Error("atkpnoUiSlider.create requires a single element."); var c = Q(b, a), d = R(a, c, b); return a.atkpnoUiSlider = d, d } y.prototype.getMargin = function (a) { var b = this.xNumSteps[0]; if (b && a % b) throw new Error("atkpnoUiSlider: 'limit' and 'margin' must be divisible by step."); return 2 === this.xPct.length && p(this.xVal, a) }, y.prototype.toStepping = function (a) { return a = t(this.xVal, this.xPct, a) }, y.prototype.fromStepping = function (a) { return u(this.xVal, this.xPct, a) }, y.prototype.getStep = function (a) { return a = v(this.xPct, this.xSteps, this.snap, a) }, y.prototype.getNearbySteps = function (a) { var b = s(a, this.xPct); return { stepBefore: { startValue: this.xVal[b - 2], step: this.xNumSteps[b - 2], highestStep: this.xHighestCompleteStep[b - 2] }, thisStep: { startValue: this.xVal[b - 1], step: this.xNumSteps[b - 1], highestStep: this.xHighestCompleteStep[b - 1] }, stepAfter: { startValue: this.xVal[b - 0], step: this.xNumSteps[b - 0], highestStep: this.xHighestCompleteStep[b - 0] } } }, y.prototype.countStepDecimals = function () { var a = this.xNumSteps.map(i); return Math.max.apply(null, a) }, y.prototype.convert = function (a) { return this.getStep(this.toStepping(a)) }; var T = { to: function (a) { return void 0 !== a && a.toFixed(2) }, from: Number }; return {create: S} }); function formatRepo(value) { if (value.loading) return value.text; if (value.id == '') return "None"; return '
      ' + value.title + '
      '; } function formatRepoSelection(repo) { var placeholder = $j(repo).parent().parent().parent().attr('placeholder'); if (repo.id == '') return repo.text; else return (repo.text || (repo.title)); } if (typeof jQuery === 'undefined') { //nothing todo }else { var $j = jQuery.noConflict(); $j(document).ready(function () { $j(".atkp-livesearch").each(function (i, obj) { var shopid = $j(obj).attr("shopid"); var filter = $j(obj).attr("filter"); var template = $j(obj).attr("template"); var endpointurl = $j(obj).attr('endpointurl'); var elementcss = $j(obj).attr('elementcss'); var containercss = $j(obj).attr('containercss'); var limit = $j(obj).attr('limit'); var init = $j(obj).attr('init'); if(init == "1") { return; } $j(obj).addClass('atkp-spinloader'); $j('.atkp-livesearch-searching').show(); $j.post(endpointurl, { action: 'atkp_live_search_render', shopid: shopid, filter: filter, template: template, elementcss: elementcss, containercss: containercss, limit: limit }, function (data, status) { //alert("Data: " + data + "\nStatus: " + status); if (status == 'success') { $j('.atkp-livesearch-searching').hide(); if (data[0].html == 'noresultfound') $j('.atkp-livesearch-noresult').show(); else if (data[0].html == 'searchtermrequired') $j('.atkp-livesearch-searchtermrequired').show(); else $j(obj).html(data[0].html); } else if (typeof data[0].error != 'undefined') $j(obj).html("error on loading: " + data[0].error); else $j(obj).html("error on loading"); $j(obj).removeClass('atkp-spinloader'); }); }); $j('.atkp-selectcontrol').each(function (i, obj) { if (!$j(obj).data('select2')) { var placeholder = $j(obj).attr('placeholder'); $j(obj).select2atkp({placeholder: placeholder, dropdownAutoWidth: true}); } }); $j('.atkp-product-selectcontrol').each(function (i, obj) { if (!$j(obj).data('select2')) { var placeholder = $j(obj).attr('placeholder'); var searchnounce = $j(obj).attr('searchnounce'); var endpointurl = $j(obj).attr('endpointurl'); var inputtooshort = $j(obj).attr('inputtooshort'); $j(obj).select2atkp({ placeholder: placeholder, dropdownAutoWidth: true, allowClear: true, language: { // You can find all of the options in the language files provided in the // build. They all must be functions that return the string that should be // displayed. inputTooShort: function () { return inputtooshort; } }, ajax: { type: "POST", url: endpointurl, dataType: 'json', delay: 250, data: function (params) { return { action: "atkp_frontend_search_products", type: "atkp_product", request_nonce: searchnounce, keyword: params.term }; }, processResults: function (data, params) { var count = 0; $j.each(data, function (key, value) { count++; }); if (count > 0) { if (typeof data[0].error != 'undefined') { alert(data[0].error + ": " + data[0].message); } else { } } /*var noselection = { id: "", name: ""}; if(count == 0) data = []; data.splice(0,0,noselection);*/ // parse the results into the format expected by Select2 // since we are using custom formatting functions we do not need to // alter the remote JSON data, except to indicate that infinite // scrolling can be used params.page = params.page || 1; return { results: data, pagination: { more: false } }; }, cache: true }, escapeMarkup: function (markup) { return markup; }, // let our custom formatter work minimumInputLength: 3, templateResult: formatRepo, // omitted for brevity, see the source of this page templateSelection: formatRepoSelection // omitted for brevity, see the source of this page }); //add remote product search } }); $j('.atkp-rangeslider').each(function (i, obj) { var minname = $j(obj).attr('minname'); var maxname = $j(obj).attr('maxname'); var minpriceval = parseFloat($j('#' + minname, obj).val()); var maxpriceval = parseFloat($j('#' + maxname, obj).val()); var minprice = parseFloat($j('#' + minname, obj).attr('defaultvalue')); var maxprice = parseFloat($j('#' + maxname, obj).attr('defaultvalue')); minprice = Math.floor((minprice + 1) / 10) * 10; maxprice = Math.ceil((maxprice + 1) / 10) * 10; minpriceval = Math.floor((minpriceval) / 10) * 10; maxpriceval = Math.ceil((maxpriceval) / 10) * 10; atkpnoUiSlider.create(obj, { start: [minpriceval, maxpriceval], connect: true, step: 10, tooltips: false, behaviour: 'tap-drag', range: { 'min': minprice, 'max': maxprice }, }); obj.atkpnoUiSlider.on('update', function (values, handle) { $j('#' + minname, obj).val(values[0]); $j('#' + maxname, obj).val(values[1]); // alert($j('#minprice', obj).parent().parent().parent().html()); $j('.minprice-display', $j('#' + minname, obj).parent().parent()).html(Math.trunc(values[0])); $j('.maxprice-display', $j('#' + maxname, obj).parent().parent()).html(Math.trunc(values[1])); }); }); }); $j(document).ready(function() { $j('.atkp-floating-bar').hide(); }); } /* atkp carousel */ jQuery(document).ready(function() { var CONSTANTS = { productMinWidth : 185, productMargin : 20 }; var $adUnits = jQuery('.atkp-product-carousel-unit'); $adUnits.each(function() { var $adUnit = jQuery(this), $wrapper = $adUnit.find('.atkp-pc-wrapper'), $productContainer = $adUnit.find('.atkp-pc-product-container'), $btnNext = $adUnit.find('.atkp-pc-btn-next'), $btnPrev = $adUnit.find('.atkp-pc-btn-prev'), $productList = $productContainer.find('.atkp-pc-product-list'), $products = $productList.find('.atkp-pc-product'), productCount = $products.length; if (!productCount) { return true; } var rows = $adUnit.find('input[name=rows]').length && parseInt($adUnit.find('input[name=rows]').val(), 10); var columns = $adUnit.find('input[name=columns]').length && parseInt($adUnit.find('input[name=columns]').val(), 10); if( columns ) { var productContainerMinWidth = columns * (CONSTANTS.productMinWidth + CONSTANTS.productMargin) + 'px'; $adUnit.css( 'min-width', productContainerMinWidth ); $productContainer.css( 'min-width', productContainerMinWidth ); $products.filter( ':nth-child(' + columns + 'n + 1)' ).css( 'clear', 'both' ); } if (rows && columns) { var cutOffIndex = (rows * columns) - 1; $products.filter(':gt(' + cutOffIndex + ')').remove(); } function updateLayout() { var wrapperWidth = $wrapper.width(); var possibleColumns = columns || parseInt( wrapperWidth / (CONSTANTS.productMinWidth + CONSTANTS.productMargin), 10 ); var actualColumns = columns || possibleColumns < productCount ? possibleColumns : productCount; /** * The actual columns can be zero when the wraperwidth is less than sum of CONSTANTS.productMinWidth and * CONSTANTS.productMargin.The parseInt will use floor function and converts any value less than 1 to * zero.Therefore making actual columns 1 . **/ if( actualColumns == 0 ) { actualColumns = 1; } var productWidth = parseInt( wrapperWidth / actualColumns, 10 ) - CONSTANTS.productMargin; $products.css( 'width', productWidth + 'px' ); /** * Removing the Carousel navigation button when the number of products selected by admin is less * than the actual columns (the number of products) can be shown on screen **/ if( productCount > actualColumns ) { $btnNext.css( 'visibility', 'visible' ).removeClass( 'disabled' ).unbind( 'click' ); $btnPrev.css( 'visibility', 'visible' ).removeClass( 'disabled' ).unbind( 'click' ); } $productContainer.jCarouselLite( { btnNext : '#' + $adUnit.attr( 'id' ) + ' .atkp-pc-btn-next', btnPrev : '#' + $adUnit.attr( 'id' ) + ' .atkp-pc-btn-prev', visible : actualColumns, circular: false } ); } updateLayout(); jQuery(window).resize(updateLayout); }); }); /*! * jCarouselLite - v1.1 - 2014-09-28 * http://www.gmarwaha.com/jquery/jcarousellite/ * Copyright (c) 2014 Ganeshji Marwaha * Licensed MIT (https://github.com/ganeshmax/jcarousellite/blob/master/LICENSE) */ !function(a){a.jCarouselLite={version:"1.1"},a.fn.jCarouselLite=function(b){return b=a.extend({},a.fn.jCarouselLite.options,b||{}),this.each(function(){function c(a){return n||(clearTimeout(A),z=a,b.beforeStart&&b.beforeStart.call(this,i()),b.circular?j(a):k(a),m({start:function(){n=!0},done:function(){b.afterEnd&&b.afterEnd.call(this,i()),b.auto&&h(),n=!1}}),b.circular||l()),!1}function d(){if(n=!1,o=b.vertical?"top":"left",p=b.vertical?"height":"width",q=B.find(">ul"),r=q.find(">li"),x=r.size(),w=x0?z-b.scroll:z+b.scroll)}),b.auto&&h()}function h(){A=setTimeout(function(){c(z+b.scroll)},b.auto)}function i(){return s.slice(z).slice(0,w)}function j(a){var c;a<=b.start-w-1?(c=a+x+b.scroll,q.css(o,-(c*t)+"px"),z=c-b.scroll):a>=y-w+1&&(c=a-x-b.scroll,q.css(o,-(c*t)+"px"),z=c+b.scroll)}function k(a){0>a?z=0:a>y-w&&(z=y-w)}function l(){a(b.btnPrev+","+b.btnNext).removeClass("disabled"),a(z-b.scroll<0&&b.btnPrev||z+b.scroll>y-w&&b.btnNext||[]).addClass("disabled")}function m(c){n=!0,q.animate("left"==o?{left:-(z*t)}:{top:-(z*t)},a.extend({duration:b.speed,easing:b.easing},c))}var n,o,p,q,r,s,t,u,v,w,x,y,z,A,B=a(this);d(),e(),f(),g()})},a.fn.jCarouselLite.options={btnPrev:null,btnNext:null,btnGo:null,mouseWheel:!1,auto:null,speed:200,easing:null,vertical:!1,circular:!0,visible:3,start:0,scroll:1,beforeStart:null,afterEnd:null}}(jQuery);